

function dataload(data){
	console.log(data)
	// 基础数据-男女比例
	//var sex_data = [['女', 40], ['男', 60]];
	var sex_data = data.sex_data;	
	// 基础数据-学历结构
	//var education_data = [['≤初中', 30], ['高中', 40], ['大专', 20], ['≥本科', 10]];
	var education_data =data.education_data
	// 基础数据-年龄结构
	//var age_categories_data = ['18以下', '19-35', '35-50', '50-60', '60以上'];
	//var age_data = [800, 200, 600, 1600, 1200];
	var age_categories_data =data.age_categories_data;
	var age_data =data.age_data;
	// 基础数据-从业结构
	//var job_categories_data = [{ text: 'ss' },{ text: '2018' },{ text: '2019' },{ text: '2020' },{ text: '2021' },{ text: '2018' }];
	//var job_data = [60, 5, 0, 100, 1500];
	var job_categories_data =data.job_categories_data;
	var job_data = data.job_data;
	// 农业从业人数
	//var nongye_data = [{ value: 300, name: '粮食作物 300人' },{ value: 220, name: '蔬菜作物 220人' },{ value: 120, name: '果树 120人' },{ value: 80, name: '畜牧业 80人' },{ value: 42, name: '非遗文化 420人' },{ value: 38, name: '其他 38人' }];
	var nongye_data = data.nongye_data;
	// 产业兴旺-人均收入
	//var chanye_renjun = [{value: 30},{value: 70}];
	var chanye_renjun = data.chanye_renjun
	var junzhi=data.junzhi
	// 生活富裕-土地面积
	var shenghuo_tudi = [{value: 100},{value: 0}];
	// 生活富裕-使用面积
	//var shenghuo_shiyong = [{value: 75},{value: 25}];
	// 生活富裕-宅基地面积
	var shenghuo_zhaijidi = [{value: 20},{value: 80}];
	// 生活富裕-农田面积
	var shenghuo_nongtian = [{value: 80},{value: 20}];
	
	// 生活富裕-子女教育
	//var shenghuo_jiaoyu_data = [{value: 30, name: '本村', selected: true },{value: 35, name: '乡镇' },{value: 15, name: '区县' },{value: 20, name: '其他' }];
	var shenghuo_jiaoyu_data=data.shenghuo_jiaoyu_data;
	// 生活富裕-出行方式
	//var shenghuo_chuxing_data = [{y:30,h: 50,color:'#F5B84D'}, {y: 10,h: 10,color:'#9BD5F4'},{y: 15,h: 20,color:'#1B52A3'},{y: 20,h: 30,color:'#26989E'},{y: 25,h: 40,color:'#F0853C'}];
	var shenghuo_chuxing_data=data.shenghuo_chuxing_data
	// 文化设施
	//var wenhuasheshi_data = [10,80,80,10];
	var wenhuasheshi_data=data.wenhuasheshi_data;
	var manyi=data.manyi;
	var manyif=data.manyif;
	$(document).ready(function(){
		/**
		 * 基础数据
		 */
		// 基础数据-男女比例
		Highcharts.chart('jichu_sex', {
			chart: {
				type: 'pie',
				backgroundColor: '',
				spacing: -5,
				options3d: {
					enabled: true,
					alpha: 45, // 内旋角度
					beta: 0 // 外旋角度
				}
			},
			title: {text: ''},
			tooltip: {enabled: false},
			credits: {enabled: false},
			plotOptions: {
				pie: {
					allowPointSelect: true,
					cursor: 'pointer',
					depth: 10,
					colors: ['#FF8D8B', '#0FA7F2'],
					dataLabels: {enabled: false,}
				}
			},
			series: [{
					type: 'pie',
					data: sex_data
			}]
		});
		// 基础数据-学历结构
		Highcharts.chart('jichu_education', {
			chart: {
				type: 'pie',
				spacing : -5,
				backgroundColor: '',
			},
			title: {text: ''},
			tooltip: {enabled: false},
			credits: {enabled: false},
			plotOptions: {
				pie: {
					allowPointSelect: true,
					cursor: 'pointer',
					colors: ['#00CCFF', '#FE904E', '#7BFF78', '#FFE38F'],
					dataLabels: {
						enabled: false,
					}
				}
			},
			series: [{
				type: 'pie',
				innerSize: '30%',
				data: education_data
			}]
		});
		// 基础数据-年龄结构
		Highcharts.chart('jichu_age',{
			chart: {
				type: 'column',
				backgroundColor: '',
				margin: 28,
				options3d: {
					enabled: true,
					alpha: 0,
					beta: 25,
					depth: 0,
					viewDistance: 100,
					frame: {                
						bottom: {
							size: 10
						},
						side: {
							size: 1,
							color: 'transparent'
						},
						back: {
							size: 1,
							color: 'transparent'
						}
					}
				},
			},
			title: {
				text: ''
			},
			plotOptions: {
				column: {
					depth: 25
				}
			},
			credits: {enabled: false},
			xAxis: {
				categories: age_categories_data,
				gridLineColor: '',
				labels: {
					style: {
						color: '#1AC9FF'
					}
				},
			},
			yAxis: {
				gridLineColor: '#999999',
				gridLineDashStyle: 'longdash',
				title: {
					text: null
				},
				labels: {
					style: {
						color: '#1AC9FF'
					}
				},
			},
			legend: {enabled: false},
			series: [{name: '年龄', data:age_data}]
		});


		/**
		 * 产业兴旺
		 */
		// 从业结构-雷达图
		var chanyeRadarChart = echarts.init(document.getElementById('chanye_radar'));
		var chanyeRadarChartOption;
		chanyeRadarChartOption = {
		  color: ['#E9B650'],
		  title: {
			text: ''
		  },
		  legend: {show:false},
		  radar: [
			{
			  indicator: job_categories_data,
			  center: ['50%', '54%'],
			  radius: '75%',
			  startAngle: 90,
			  splitNumber: 4,
			  axisName: {
				color: '#7CB1FF'
			  },
			  splitArea: {
				areaStyle: {
				  color: ['#4fb5c7', '#2d6873', '#214c54', '#122a2f'],
				  shadowColor: 'rgba(0, 0, 0, 0.2)',
				  shadowBlur: 4,
				  opacity: 0.7
				}
			  },
			  axisLine: {
				lineStyle: {
				  color: '#61e5fc'
				}
			  },
			  splitLine: {
				lineStyle: {
				  color: 'transparent'
				}
			  }
			}
		  ],
		  series: [
			{
			  type: 'radar',
			  emphasis: {
				lineStyle: {
				  width: 4
				}
			  },
			  data: [
				{
				  value: job_data,
				  areaStyle: {
					color: '#E9B650'
				  }
				}
			  ]
			}
		  ]
		};
		
		chanyeRadarChartOption && chanyeRadarChart.setOption(chanyeRadarChartOption);

		// 农业从业人数- 玫瑰图
		var nongyeRadarChart = echarts.init(document.getElementById('nongye_radar'));
		var nongyeRadarChartOption;
		nongyeRadarChartOption = {
			color: [
				{
					type: 'linear',
					x: 0.5,
					y: 0.5,
					r: 0.5,
					colorStops: [{
						offset: 0, color: '#0FD5F9' // 0% 处的颜色
					}, {
						offset: 1, color: '#0487ED' // 100% 处的颜色
					}],
				},
				{
					type: 'linear',
					x: 0.5,
					y: 0.5,
					r: 0.5,
					colorStops: [{
						offset: 0, color: '#0487ED' // 0% 处的颜色
					}, {
						offset: 1, color: '#0666E8' // 100% 处的颜色
					}],
				},
				{
					type: 'linear',
					x: 0.5,
					y: 0.5,
					r: 0.5,
					colorStops: [{
						offset: 0, color: '#A2FFD0' // 0% 处的颜色
					}, {
						offset: 1, color: '#3EB076' // 100% 处的颜色
					}],
				},
				{
					type: 'linear',
					x: 0.5,
					y: 0.5,
					r: 0.5,
					colorStops: [{
						offset: 0, color: '#FFFE95' // 0% 处的颜色
					}, {
						offset: 1, color: '#C1C049' // 100% 处的颜色
					}],
				},
				{
					type: 'linear',
					x: 0.5,
					y: 0.5,
					r: 0.5,
					colorStops: [{
						offset: 0, color: '#FF9000' // 0% 处的颜色
					}, {
						offset: 1, color: '#FFCD5E' // 100% 处的颜色
					}],
				},
				{
					type: 'linear',
					x: 0.5,
					y: 0.5,
					r: 0.5,
					colorStops: [{
						offset: 0, color: '#EE7CFF' // 0% 处的颜色
					}, {
						offset: 1, color: '#932AE1' // 100% 处的颜色
					}],
				},
			],
			legend: {show:false},
			toolbox: {
			  show: false,
			},
			series: [
			  {
				name: '农业从业人数',
				type: 'pie',
				center: ['50%', '50%'],
				radius: '85%',
				roseType: 'radius',
				itemStyle: {
				  borderRadius: 2
				},
				label: {
				  show: false
				},
				data: nongye_data
			  }
			]
		};
		nongyeRadarChartOption && nongyeRadarChart.setOption(nongyeRadarChartOption);
		
		// 人均收入
		var renjunRadarChart = echarts.init(document.getElementById('renjun_radar'));
		var renjunRadarChartOption;
		renjunRadarChartOption = {
			// color:['#FFE18F', '#00FF9C', '#34ECFF'],
			color: [
				{
					type: 'linear',
					x: 0.5,
					y: 0.5,
					r: 0.5,
					colorStops: [{
						offset: 0, color: '#FFE18F' // 0% 处的颜色
					}, {
						offset: 1, color: '#b39e65' // 100% 处的颜色
					}],
				},
				{
					type: 'linear',
					x: 0.5,
					y: 0.5,
					r: 0.5,
					colorStops: [{
						offset: 0, color: '#00FF9C' // 0% 处的颜色
					}, {
						offset: 1, color: '#00b36e' // 100% 处的颜色
					}],
				},
				{
					type: 'linear',
					x: 0.5,
					y: 0.5,
					r: 0.5,
					colorStops: [{
						offset: 0, color: '#34ECFF' // 0% 处的颜色
					}, {
						offset: 1, color: '#26a8b7' // 100% 处的颜色
					}],
				},
			],
			tooltip: {show: false},
			legend: {show:false},
			title: {
			  text:junzhi+'万/年',
			  top:'42%',
			  left:'22%',
			  textStyle: {
				color: '#fff',
				fontSize: 14
			  }
			},
			series: [
			  {
				name: 'Access From',
				type: 'pie',
				radius: ['70%', '90%'],
				center: ['50%', '50%'],
				avoidLabelOverlap: false,
				itemStyle: {
				  borderWidth: 0
				},
				label: {
					show: false
				},
				labelLine: {
				  show: false
				},
				data: chanye_renjun
			  }
			]
		};
		renjunRadarChartOption && renjunRadarChart.setOption(renjunRadarChartOption);


		// 生活富裕-土地面积
		var tudimianjiRadarChart = echarts.init(document.getElementById('tudi_radar1'));
		var tudimianjiRadarChartOption;
		tudimianjiRadarChartOption = {
			color:['#DA0051', '#33395D'],
			tooltip: {show: false},
			legend: {show:false},
			title: {
			  text:'100%',
			  top:'46%',
			  left:'26%',
			  textStyle: {
				color: '#fff',
				fontSize: 14
			  }
			},
			series: [
			  {
				name: 'Access From',
				type: 'pie',
				radius: ['60%', '80%'],
				center: ['50%', '54%'],
				avoidLabelOverlap: false,
				itemStyle: {
				  borderWidth: 0
				},
				label: {
					show: false
				},
				labelLine: {
				  show: false
				},
				data: shenghuo_tudi
			  }
			]
		};
		tudimianjiRadarChartOption && tudimianjiRadarChart.setOption(tudimianjiRadarChartOption);

		// 生活富裕-使用面积
		/*var shiyongmianjiRadarChart = echarts.init(document.getElementById('tudi_radar2'));
		var shiyongmianjiRadarChartOption;
		shiyongmianjiRadarChartOption = {
			color:['#FFB508', '#33395D'],
			tooltip: {show: false},
			legend: {show:false},
			title: {
			  text:'75%',
			  top:'46%',
			  left:'30%',
			  textStyle: {
				color: '#fff',
				fontSize: 14
			  }
			},
			series: [
			  {
				name: 'Access From',
				type: 'pie',
				radius: ['60%', '80%'],
				center: ['50%', '54%'],
				avoidLabelOverlap: false,
				itemStyle: {
				  borderWidth: 0
				},
				label: {
					show: false
				},
				labelLine: {
				  show: false
				},
				data: shenghuo_shiyong
			  }
			]
		};
		shiyongmianjiRadarChartOption && shiyongmianjiRadarChart.setOption(shiyongmianjiRadarChartOption);*/

		// 生活富裕-宅基地面积
		var zhaijidimianjiRadarChart = echarts.init(document.getElementById('tudi_radar3'));
		var zhaijidimianjiRadarChartOption;
		zhaijidimianjiRadarChartOption = {
			color:['#01BD8D', '#33395D'],
			tooltip: {show: false},
			legend: {show:false},
			title: {
			  text:'20%',
			  top:'46%',
			  left:'30%',
			  textStyle: {
				color: '#fff',
				fontSize: 14
			  }
			},
			series: [
			  {
				name: 'Access From',
				type: 'pie',
				radius: ['60%', '80%'],
				center: ['50%', '54%'],
				avoidLabelOverlap: false,
				itemStyle: {
				  borderWidth: 0
				},
				label: {
					show: false
				},
				labelLine: {
				  show: false
				},
				data: shenghuo_zhaijidi
			  }
			]
		};
		zhaijidimianjiRadarChartOption && zhaijidimianjiRadarChart.setOption(zhaijidimianjiRadarChartOption);


		// 生活富裕-农田面积
		var nongtianmianjiRadarChart = echarts.init(document.getElementById('tudi_radar4'));
		var nongtianmianjiRadarChartOption;
		nongtianmianjiRadarChartOption = {
			color:['#9877FF', '#33395D'],
			tooltip: {show: false},
			legend: {show:false},
			title: {
			  text:'80%',
			  top:'46%',
			  left:'30%',
			  textStyle: {
				color: '#fff',
				fontSize: 14
			  }
			},
			series: [
			  {
				name: 'Access From',
				type: 'pie',
				radius: ['60%', '80%'],
				center: ['50%', '54%'],
				avoidLabelOverlap: false,
				itemStyle: {
				  borderWidth: 0
				},
				label: {
					show: false
				},
				labelLine: {
				  show: false
				},
				data: shenghuo_nongtian
			  }
			]
		};
		nongtianmianjiRadarChartOption && nongtianmianjiRadarChart.setOption(nongtianmianjiRadarChartOption);


		// 生活富裕-子女教育
		var jiaoyuRadarChart = echarts.init(document.getElementById('jiaoyu_radar'));
		var jiaoyuRadarChartOption;
		jiaoyuRadarChartOption = {
			color: [
				{
					type: 'linear',
					x: 0.5,
					y: 0.5,
					r: 0.5,
					colorStops: [{
						offset: 0, color: '#FF934C' // 0% 处的颜色
					}, {
						offset: 1, color: '#FC686F' // 100% 处的颜色
					}],
				},
				{
					type: 'linear',
					x: 0.5,
					y: 0.5,
					r: 0.5,
					colorStops: [{
						offset: 0, color: '#835DFF' // 0% 处的颜色
					}, {
						offset: 1, color: '#4311E0' // 100% 处的颜色
					}],
				},
				{
					type: 'linear',
					x: 0.5,
					y: 0.5,
					r: 0.5,
					colorStops: [{
						offset: 0, color: '#4061F7' // 0% 处的颜色
					}, {
						offset: 1, color: '#1028D0' // 100% 处的颜色
					}],
				},
				{
					type: 'linear',
					x: 0.5,
					y: 0.5,
					r: 0.5,
					colorStops: [{
						offset: 0, color: '#67CEE8' // 0% 处的颜色
					}, {
						offset: 1, color: '#3A84BB' // 100% 处的颜色
					}],
				}
			],
			tooltip: {show: false},
			legend: {show:false},
			series: [
				{
					name: 'Access From',
					type: 'pie',
					selectedMode: 'single',
					center: ['50%', '54%'],
					radius: [0, '80%'],
					label: {
						position: 'inner',
						fontSize: 14,
						color: '#ffffff'
					  },
					labelLine: {
						show: false
					},
					data: shenghuo_jiaoyu_data
				}
			]
		};
		jiaoyuRadarChartOption && jiaoyuRadarChart.setOption(jiaoyuRadarChartOption);


		// 生活富裕-出行方式
		// 修改3d环形图绘制过程
		var each = Highcharts.each,
		round = Math.round,
		cos = Math.cos,
		sin = Math.sin,
		deg2rad = Math.deg2rad;
		Highcharts.wrap(Highcharts.seriesTypes.pie.prototype, 'translate', function(proceed) {
			proceed.apply(this, [].slice.call(arguments, 1));
			if (!this.chart.is3d()) {
				return;
			}
			var series = this,
				chart = series.chart,
				options = chart.options,
				seriesOptions = series.options,
				depth = seriesOptions.depth || 0,
				options3d = options.chart.options3d,
				alpha = options3d.alpha,
				beta = options3d.beta,
				z = seriesOptions.stacking ? (seriesOptions.stack || 0) * depth : series._i * depth;
			z += depth / 2;
			if (seriesOptions.grouping !== false) {
				z = 0;
			}
			each(series.data, function(point) {
				var shapeArgs = point.shapeArgs,
					angle;
				point.shapeType = 'arc3d';
				var ran = point.options.h;
				shapeArgs.z = z;
				shapeArgs.depth = depth * 0.75 + ran;
				shapeArgs.alpha = alpha;
				shapeArgs.beta = beta;
				shapeArgs.center = series.center;
				shapeArgs.ran = ran;
				angle = (shapeArgs.end + shapeArgs.start) / 2;
				point.slicedTranslation = {
					translateX: round(cos(angle) * seriesOptions.slicedOffset * cos(alpha * deg2rad)),
					translateY: round(sin(angle) * seriesOptions.slicedOffset * cos(alpha * deg2rad))
				};
			});
		});
		Highcharts.chart('chuxing_radar', {
		chart: {
			type: 'pie',
			backgroundColor: 'rgba(0,0,0,0)',
			events: {
				load: function() {
					var each = Highcharts.each,
						points = this.series[0].points;
						console.log(this.series);
					each(points, function(p) {
						p.graphic.attr({
							translateY: -p.shapeArgs.ran
						});
						p.graphic.side1.attr({
							translateY: -p.shapeArgs.ran
						});
						p.graphic.side2.attr({
							translateY: -p.shapeArgs.ran
						});
					});
				}
			},
			options3d: {
				enabled: true,
				alpha: 70,
			},
			spacingTop: 70
		},
		title: {
			text: ''
		},
		credits: {
			enabled: false
		},
		subtitle: {
			text: ''
		},
		tooltip: {
			enabled: false
		},
		plotOptions: {
			pie: {
				allowPointSelect: true,
				cursor: 'pointer',
				depth: 0,
				innerSize: 90,
				center: ['50%', '50%'],
				dataLabels: {
					enabled: false
				}
			}
		},
		series: [{
			type: 'pie',
			name: '出行方式',
			size: '570%',
			data: shenghuo_chuxing_data

		}]
		});


		// 文化设施
		Highcharts.chart('wenhua_radar', {
			chart: {
				type: 'pyramid3d',
				backgroundColor: '',
				options3d: {
					enabled: true,
					alpha: 10,
					depth: 50,
					viewDistance: 50
				}
			},
			title: {text: ''},
			tooltip: {enabled: false},
			credits: {enabled: false},
			plotOptions: {
				series: {
					dataLabels: {
						enabled: false,
					},
					width: '80%',
					height: '60%',
					center: ['50%', '40%'],
					colors: ['#0090EF', '#0CDAF8', '#32FF94', '#FFFE7F'],
				}
			},
			series: [{
				name: '文化设施',
				data: wenhuasheshi_data
			}]
		});


		// 满意度调查
		var mayiduRadarChart = echarts.init(document.getElementById('manyidu_radar'));
		var mayiduRadarChartOption;
		mayiduRadarChartOption = {
			 
			grid: {
				top: 20,
				left: 80,
				bottom: 30
			},
			xAxis: {
				type: 'category',
				boundaryGap: [0, '4%'],
				data: manyif,
				axisLine: {
					lineStyle : {
						color: '#1AC9FF'
					},
					symbolOffset: [20, 10]
				}
			  },
			  yAxis: {
				type: 'category',
				data:  [
					{ value: '不满意', textStyle: {color: '#1AC9FF', fontSize: '18'} },
					{ value: '一般', textStyle: {color: '#1AC9FF', fontSize: '18'} },
					{ value: '基本满意', textStyle: {color: '#1AC9FF', fontSize: '18'} },
					{ value: '非常满意', textStyle: {color: '#1AC9FF', fontSize: '18'} },
				],
				axisLine: {
					lineStyle : {
						color: '#1AC9FF'
					}
				},
			  },
			  series: [
				{
					data: manyi,
					type: 'line',
					areaStyle: {},
					smooth: true
				}
			  ]
		};
		mayiduRadarChartOption && mayiduRadarChart.setOption(mayiduRadarChartOption);


	});
}
  






